OCI Generative AI Integration for LangChain#2925
Merged
Mason Daugherty (mdrxy) merged 14 commits intolangchain-ai:mainfrom Mar 5, 2026
Merged
OCI Generative AI Integration for LangChain#2925Mason Daugherty (mdrxy) merged 14 commits intolangchain-ai:mainfrom
Mason Daugherty (mdrxy) merged 14 commits intolangchain-ai:mainfrom
Conversation
Contributor
❌ Import check failedThis PR contains imports from Detailed issuesWhy this is a problemThe
How to fixReplace the imports as suggested above. For example:
🤖 Automated checkThis check is based on the latest analysis of |
Brought the OCI docs up to date with the current langchain-oci package. The old docs were still referencing langchain-community and missing most of the newer features. Main updates: - Provider overview now covers all auth methods and model types - Chat integration docs match the standard template with feature tables - Added vision, tool calling, structured output examples - Embeddings docs now cover image embeddings and cross-modal search - Updated all examples to use langchain-oci package Should bring OCI docs in line with other major provider integrations.
0482a72 to
577e065
Compare
Changed imports to use langchain package instead of langchain_core for better user experience and consistency.
Simplified all three docs to be more teaching-oriented: - Removed redundant setup and auth examples - Consolidated similar examples - Made tool calling explain WHY not just HOW - Simplified multimodal sections - Removed unnecessary model configuration details - Streamlined embeddings to focus on core concepts Focused on progressive learning without repetition.
Updated all code examples across provider overview, chat, and embeddings documentation to use realistic production use cases instead of simple demos: - Tool calling: Analytics queries, stock prices (was weather API) - Structured output: Support ticket parsing (was person extraction) - Vision: Architecture diagrams, chart data extraction (was generic images) - Multimodal: Contract analysis, meeting transcription (was simple summaries) - Embeddings: Code documentation search, technical diagrams (was simple text) - AI Agents: Infrastructure monitoring (was search tutorials) All examples now demonstrate real engineering scenarios: security analysis, compliance auditing, log parsing, data extraction, and automation pipelines.
Created complete test suite validating all code examples from OCI documentation: - 17/18 tests passing (1 skipped - FAISS dependency) - Tests validate chat models, embeddings, vision, multimodal, and AI agents - All examples are engineering-focused and production-ready - Tests use real OCI services with proper authentication - Includes conftest fixtures, test runner script, and comprehensive README Test coverage: - Chat Models: Basic invocation, streaming, async, tool calling, structured output - Embeddings: Text/image embeddings, RAG integration - Provider Features: Authentication, vision, Gemini multimodal, AI agents All documentation examples are now validated against real OCI GenAI services.
- Add backticks around class name in API Reference section (ChatOCIGenAI) - Add backticks around class name in Related links (ChatOCIGenAI) - Improve consistency with LangChain documentation standards Per feedback from @mdrxy on PR langchain-ai#2925
- Add backticks around class names in integration tables - Update API reference URLs to use reference.langchain.com/python/langchain-oci - Add backticks around OCIGenAIEmbeddings in API Reference section - Use package-level API reference (matches Bedrock pattern) Addresses all inline comments from @mdrxy in PR langchain-ai#2925
The langchain-oci package does not have published API docs on reference.langchain.com yet. Updated all API reference links to point to the GitHub repository instead.
All three documents now use 'OCI Generative AI Integration for LangChain' as the title for consistent branding, rather than focusing on individual class names like ChatOCIGenAI.
Tests have been moved to langchain-oracle repository as requested by reviewer. The docs repo should not contain integration tests for external packages.
Mason Daugherty (mdrxy)
approved these changes
Mar 5, 2026
cc758ce
into
langchain-ai:main
11 of 12 checks passed
This was referenced Mar 5, 2026
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Mar 5, 2026
## Summary Follow-up improvements to OCI Generative AI documentation (#2925) based on testing this morning. Apologies for the separate PR - I was working on these improvements when the original was merged. **Changes:** 1. **Add example outputs** - Show actual model responses so developers know what to expect 2. **Complete tool calling flow** - Added full `ToolMessage` execution loop (was missing) 3. **Fix Gemini PDF format** - Changed `{"type": "media", ...}` to correct `{"type": "document_url", ...}` format 4. **Simplify examples** - Use strings/tuples where `HumanMessage` isn't required: - `llm.invoke("question")` instead of `llm.invoke([HumanMessage(...)])` - `("user", "..."), ("assistant", "...")` tuples for multi-turn ## Testing All 13 integration tests pass against real OCI GenAI services: - Basic invocation, multi-turn, streaming, async - Tool calling with complete execution loop - Structured output with Pydantic - Vision (Llama 3.2 90B) - Gemini PDF processing - Text & image embeddings (Cohere) - RAG with FAISS - AI Agent (`create_oci_agent`) ## Files Changed - `src/oss/python/integrations/chat/oci_generative_ai.mdx` - `src/oss/python/integrations/providers/oci.mdx` - `src/oss/python/integrations/text_embedding/oci_generative_ai.mdx`
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's this about
OCI Generative AI Integration for LangChain - comprehensive documentation for the langchain-oci package covering all authentication methods, features, and capabilities.
What changed
Updated the three main OCI docs pages:
providers/oci.mdx - Updated the provider overview with proper auth examples for all four methods (API key, security token, instance principal, resource principal), documented features like vision models and AI agents, and added a section on OCI Data Science deployments.
chat/oci_generative_ai.mdx - Brought the documentation up to the same format as other provider integrations (like Bedrock), added the feature tables, and documented tool calling, structured output, vision capabilities, and async operations. Also covered the Gemini models that can handle PDFs and video.
text_embedding/oci_generative_ai.mdx - Updated embeddings docs to cover both text and image embeddings. Added examples for cross-modal search with the multimodal Cohere models.
Coverage
The docs now cover: